package com.nlgc365.designpattern.Chapter02_Principle.P01_SRP.CorrectExample1;

public class Shape {
    private double width;
    private double height;

    public Shape(double width, double height) {
        this.width = width;
        this.height = height;
    }

    /**
     * 职责1: 计算面积(只保留一个职责)
     *
     * @return
     */
    public double getArea() {
        return width * height;
    }

    /**
     * 职责2: 绘图 (删除该职责)
     */
    /*
    public void draw() {
        System.out.println("Drawing shape with width: " + width + ", height: " + height);
    }
    public void draw() {
        System.out.println(message);
    }*/
}